Integrand size = 24, antiderivative size = 134 \[ \int \frac {(e+f x) \csc (c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {2 (e+f x) \text {arctanh}\left (e^{i (c+d x)}\right )}{a d}+\frac {(e+f x) \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {2 f \log \left (\sin \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )\right )}{a d^2}+\frac {i f \operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right )}{a d^2}-\frac {i f \operatorname {PolyLog}\left (2,e^{i (c+d x)}\right )}{a d^2} \]
-2*(f*x+e)*arctanh(exp(I*(d*x+c)))/a/d+(f*x+e)*cot(1/2*c+1/4*Pi+1/2*d*x)/a /d-2*f*ln(sin(1/2*c+1/4*Pi+1/2*d*x))/a/d^2+I*f*polylog(2,-exp(I*(d*x+c)))/ a/d^2-I*f*polylog(2,exp(I*(d*x+c)))/a/d^2
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(300\) vs. \(2(134)=268\).
Time = 6.30 (sec) , antiderivative size = 300, normalized size of antiderivative = 2.24 \[ \int \frac {(e+f x) \csc (c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (-2 d (e+f x) \sin \left (\frac {1}{2} (c+d x)\right )+f (c+d x) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-2 f \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+d e \log \left (\tan \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-c f \log \left (\tan \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+f \left ((c+d x) \left (\log \left (1-e^{i (c+d x)}\right )-\log \left (1+e^{i (c+d x)}\right )\right )+i \left (\operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right )-\operatorname {PolyLog}\left (2,e^{i (c+d x)}\right )\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )}{a d^2 (1+\sin (c+d x))} \]
((Cos[(c + d*x)/2] + Sin[(c + d*x)/2])*(-2*d*(e + f*x)*Sin[(c + d*x)/2] + f*(c + d*x)*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2]) - 2*f*Log[Cos[(c + d*x)/ 2] + Sin[(c + d*x)/2]]*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2]) + d*e*Log[Tan [(c + d*x)/2]]*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2]) - c*f*Log[Tan[(c + d* x)/2]]*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2]) + f*((c + d*x)*(Log[1 - E^(I* (c + d*x))] - Log[1 + E^(I*(c + d*x))]) + I*(PolyLog[2, -E^(I*(c + d*x))] - PolyLog[2, E^(I*(c + d*x))]))*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])))/(a *d^2*(1 + Sin[c + d*x]))
Time = 0.66 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.01, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.458, Rules used = {5046, 3042, 3799, 3042, 4671, 2715, 2838, 4672, 3042, 25, 3956}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {(e+f x) \csc (c+d x)}{a \sin (c+d x)+a} \, dx\) |
\(\Big \downarrow \) 5046 |
\(\displaystyle \frac {\int (e+f x) \csc (c+d x)dx}{a}-\int \frac {e+f x}{\sin (c+d x) a+a}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int (e+f x) \csc (c+d x)dx}{a}-\int \frac {e+f x}{\sin (c+d x) a+a}dx\) |
\(\Big \downarrow \) 3799 |
\(\displaystyle \frac {\int (e+f x) \csc (c+d x)dx}{a}-\frac {\int (e+f x) \csc ^2\left (\frac {c}{2}+\frac {d x}{2}+\frac {\pi }{4}\right )dx}{2 a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int (e+f x) \csc (c+d x)dx}{a}-\frac {\int (e+f x) \csc \left (\frac {c}{2}+\frac {d x}{2}+\frac {\pi }{4}\right )^2dx}{2 a}\) |
\(\Big \downarrow \) 4671 |
\(\displaystyle -\frac {\int (e+f x) \csc \left (\frac {c}{2}+\frac {d x}{2}+\frac {\pi }{4}\right )^2dx}{2 a}+\frac {-\frac {f \int \log \left (1-e^{i (c+d x)}\right )dx}{d}+\frac {f \int \log \left (1+e^{i (c+d x)}\right )dx}{d}-\frac {2 (e+f x) \text {arctanh}\left (e^{i (c+d x)}\right )}{d}}{a}\) |
\(\Big \downarrow \) 2715 |
\(\displaystyle -\frac {\int (e+f x) \csc \left (\frac {c}{2}+\frac {d x}{2}+\frac {\pi }{4}\right )^2dx}{2 a}+\frac {\frac {i f \int e^{-i (c+d x)} \log \left (1-e^{i (c+d x)}\right )de^{i (c+d x)}}{d^2}-\frac {i f \int e^{-i (c+d x)} \log \left (1+e^{i (c+d x)}\right )de^{i (c+d x)}}{d^2}-\frac {2 (e+f x) \text {arctanh}\left (e^{i (c+d x)}\right )}{d}}{a}\) |
\(\Big \downarrow \) 2838 |
\(\displaystyle -\frac {\int (e+f x) \csc \left (\frac {c}{2}+\frac {d x}{2}+\frac {\pi }{4}\right )^2dx}{2 a}+\frac {-\frac {2 (e+f x) \text {arctanh}\left (e^{i (c+d x)}\right )}{d}+\frac {i f \operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right )}{d^2}-\frac {i f \operatorname {PolyLog}\left (2,e^{i (c+d x)}\right )}{d^2}}{a}\) |
\(\Big \downarrow \) 4672 |
\(\displaystyle -\frac {\frac {2 f \int \cot \left (\frac {c}{2}+\frac {d x}{2}+\frac {\pi }{4}\right )dx}{d}-\frac {2 (e+f x) \cot \left (\frac {c}{2}+\frac {d x}{2}+\frac {\pi }{4}\right )}{d}}{2 a}+\frac {-\frac {2 (e+f x) \text {arctanh}\left (e^{i (c+d x)}\right )}{d}+\frac {i f \operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right )}{d^2}-\frac {i f \operatorname {PolyLog}\left (2,e^{i (c+d x)}\right )}{d^2}}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {\frac {2 f \int -\tan \left (\frac {c}{2}+\frac {d x}{2}+\frac {3 \pi }{4}\right )dx}{d}-\frac {2 (e+f x) \cot \left (\frac {c}{2}+\frac {d x}{2}+\frac {\pi }{4}\right )}{d}}{2 a}+\frac {-\frac {2 (e+f x) \text {arctanh}\left (e^{i (c+d x)}\right )}{d}+\frac {i f \operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right )}{d^2}-\frac {i f \operatorname {PolyLog}\left (2,e^{i (c+d x)}\right )}{d^2}}{a}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\frac {-\frac {2 f \int \tan \left (\frac {1}{4} (2 c+3 \pi )+\frac {d x}{2}\right )dx}{d}-\frac {2 (e+f x) \cot \left (\frac {c}{2}+\frac {d x}{2}+\frac {\pi }{4}\right )}{d}}{2 a}+\frac {-\frac {2 (e+f x) \text {arctanh}\left (e^{i (c+d x)}\right )}{d}+\frac {i f \operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right )}{d^2}-\frac {i f \operatorname {PolyLog}\left (2,e^{i (c+d x)}\right )}{d^2}}{a}\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle -\frac {\frac {4 f \log \left (-\cos \left (\frac {c}{2}+\frac {d x}{2}-\frac {\pi }{4}\right )\right )}{d^2}-\frac {2 (e+f x) \cot \left (\frac {c}{2}+\frac {d x}{2}+\frac {\pi }{4}\right )}{d}}{2 a}+\frac {-\frac {2 (e+f x) \text {arctanh}\left (e^{i (c+d x)}\right )}{d}+\frac {i f \operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right )}{d^2}-\frac {i f \operatorname {PolyLog}\left (2,e^{i (c+d x)}\right )}{d^2}}{a}\) |
-1/2*((-2*(e + f*x)*Cot[c/2 + Pi/4 + (d*x)/2])/d + (4*f*Log[-Cos[c/2 - Pi/ 4 + (d*x)/2]])/d^2)/a + ((-2*(e + f*x)*ArcTanh[E^(I*(c + d*x))])/d + (I*f* PolyLog[2, -E^(I*(c + d*x))])/d^2 - (I*f*PolyLog[2, E^(I*(c + d*x))])/d^2) /a
3.2.99.3.1 Defintions of rubi rules used
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Simp[1/(d*e*n*Log[F]) Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) ))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 , (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.) , x_Symbol] :> Simp[(2*a)^n Int[(c + d*x)^m*Sin[(1/2)*(e + Pi*(a/(2*b))) + f*(x/2)]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2 - b^ 2, 0] && IntegerQ[n] && (GtQ[n, 0] || IGtQ[m, 0])
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d *x], x]]/d, x] /; FreeQ[{c, d}, x]
Int[csc[(e_.) + (f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[- 2*(c + d*x)^m*(ArcTanh[E^(I*(e + f*x))]/f), x] + (-Simp[d*(m/f) Int[(c + d*x)^(m - 1)*Log[1 - E^(I*(e + f*x))], x], x] + Simp[d*(m/f) Int[(c + d*x )^(m - 1)*Log[1 + E^(I*(e + f*x))], x], x]) /; FreeQ[{c, d, e, f}, x] && IG tQ[m, 0]
Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp [(-(c + d*x)^m)*(Cot[e + f*x]/f), x] + Simp[d*(m/f) Int[(c + d*x)^(m - 1) *Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]
Int[(Csc[(c_.) + (d_.)*(x_)]^(n_.)*((e_.) + (f_.)*(x_))^(m_.))/((a_) + (b_. )*Sin[(c_.) + (d_.)*(x_)]), x_Symbol] :> Simp[1/a Int[(e + f*x)^m*Csc[c + d*x]^n, x], x] - Simp[b/a Int[(e + f*x)^m*(Csc[c + d*x]^(n - 1)/(a + b*S in[c + d*x])), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IGtQ[m, 0] && IGtQ [n, 0]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 244 vs. \(2 (114 ) = 228\).
Time = 0.40 (sec) , antiderivative size = 245, normalized size of antiderivative = 1.83
method | result | size |
risch | \(\frac {2 f x +2 e}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}+\frac {2 f \ln \left ({\mathrm e}^{i \left (d x +c \right )}\right )}{d^{2} a}-\frac {2 f \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{a \,d^{2}}+\frac {f \ln \left (1-{\mathrm e}^{i \left (d x +c \right )}\right ) x}{d a}-\frac {f \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) x}{d a}+\frac {e \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d a}-\frac {e \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d a}-\frac {c f \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d^{2} a}+\frac {f \ln \left (1-{\mathrm e}^{i \left (d x +c \right )}\right ) c}{d^{2} a}-\frac {i f \,\operatorname {Li}_{2}\left ({\mathrm e}^{i \left (d x +c \right )}\right )}{a \,d^{2}}+\frac {i f \,\operatorname {Li}_{2}\left (-{\mathrm e}^{i \left (d x +c \right )}\right )}{a \,d^{2}}\) | \(245\) |
2*(f*x+e)/d/a/(exp(I*(d*x+c))+I)+2/d^2/a*f*ln(exp(I*(d*x+c)))-2*f/a/d^2*ln (exp(I*(d*x+c))+I)+1/d/a*f*ln(1-exp(I*(d*x+c)))*x-1/d/a*f*ln(exp(I*(d*x+c) )+1)*x+1/d/a*e*ln(exp(I*(d*x+c))-1)-1/d/a*e*ln(exp(I*(d*x+c))+1)-1/d^2/a*c *f*ln(exp(I*(d*x+c))-1)+1/d^2/a*f*ln(1-exp(I*(d*x+c)))*c-I*f*polylog(2,exp (I*(d*x+c)))/a/d^2+I*f*polylog(2,-exp(I*(d*x+c)))/a/d^2
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 609 vs. \(2 (110) = 220\).
Time = 0.29 (sec) , antiderivative size = 609, normalized size of antiderivative = 4.54 \[ \int \frac {(e+f x) \csc (c+d x)}{a+a \sin (c+d x)} \, dx=\frac {2 \, d f x + 2 \, d e + 2 \, {\left (d f x + d e\right )} \cos \left (d x + c\right ) + {\left (-i \, f \cos \left (d x + c\right ) - i \, f \sin \left (d x + c\right ) - i \, f\right )} {\rm Li}_2\left (\cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) + {\left (i \, f \cos \left (d x + c\right ) + i \, f \sin \left (d x + c\right ) + i \, f\right )} {\rm Li}_2\left (\cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) + {\left (-i \, f \cos \left (d x + c\right ) - i \, f \sin \left (d x + c\right ) - i \, f\right )} {\rm Li}_2\left (-\cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) + {\left (i \, f \cos \left (d x + c\right ) + i \, f \sin \left (d x + c\right ) + i \, f\right )} {\rm Li}_2\left (-\cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) - {\left (d f x + d e + {\left (d f x + d e\right )} \cos \left (d x + c\right ) + {\left (d f x + d e\right )} \sin \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right ) + i \, \sin \left (d x + c\right ) + 1\right ) - {\left (d f x + d e + {\left (d f x + d e\right )} \cos \left (d x + c\right ) + {\left (d f x + d e\right )} \sin \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right ) - i \, \sin \left (d x + c\right ) + 1\right ) + {\left (d e - c f + {\left (d e - c f\right )} \cos \left (d x + c\right ) + {\left (d e - c f\right )} \sin \left (d x + c\right )\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2} i \, \sin \left (d x + c\right ) + \frac {1}{2}\right ) + {\left (d e - c f + {\left (d e - c f\right )} \cos \left (d x + c\right ) + {\left (d e - c f\right )} \sin \left (d x + c\right )\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) - \frac {1}{2} i \, \sin \left (d x + c\right ) + \frac {1}{2}\right ) + {\left (d f x + c f + {\left (d f x + c f\right )} \cos \left (d x + c\right ) + {\left (d f x + c f\right )} \sin \left (d x + c\right )\right )} \log \left (-\cos \left (d x + c\right ) + i \, \sin \left (d x + c\right ) + 1\right ) + {\left (d f x + c f + {\left (d f x + c f\right )} \cos \left (d x + c\right ) + {\left (d f x + c f\right )} \sin \left (d x + c\right )\right )} \log \left (-\cos \left (d x + c\right ) - i \, \sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (f \cos \left (d x + c\right ) + f \sin \left (d x + c\right ) + f\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (d f x + d e\right )} \sin \left (d x + c\right )}{2 \, {\left (a d^{2} \cos \left (d x + c\right ) + a d^{2} \sin \left (d x + c\right ) + a d^{2}\right )}} \]
1/2*(2*d*f*x + 2*d*e + 2*(d*f*x + d*e)*cos(d*x + c) + (-I*f*cos(d*x + c) - I*f*sin(d*x + c) - I*f)*dilog(cos(d*x + c) + I*sin(d*x + c)) + (I*f*cos(d *x + c) + I*f*sin(d*x + c) + I*f)*dilog(cos(d*x + c) - I*sin(d*x + c)) + ( -I*f*cos(d*x + c) - I*f*sin(d*x + c) - I*f)*dilog(-cos(d*x + c) + I*sin(d* x + c)) + (I*f*cos(d*x + c) + I*f*sin(d*x + c) + I*f)*dilog(-cos(d*x + c) - I*sin(d*x + c)) - (d*f*x + d*e + (d*f*x + d*e)*cos(d*x + c) + (d*f*x + d *e)*sin(d*x + c))*log(cos(d*x + c) + I*sin(d*x + c) + 1) - (d*f*x + d*e + (d*f*x + d*e)*cos(d*x + c) + (d*f*x + d*e)*sin(d*x + c))*log(cos(d*x + c) - I*sin(d*x + c) + 1) + (d*e - c*f + (d*e - c*f)*cos(d*x + c) + (d*e - c*f )*sin(d*x + c))*log(-1/2*cos(d*x + c) + 1/2*I*sin(d*x + c) + 1/2) + (d*e - c*f + (d*e - c*f)*cos(d*x + c) + (d*e - c*f)*sin(d*x + c))*log(-1/2*cos(d *x + c) - 1/2*I*sin(d*x + c) + 1/2) + (d*f*x + c*f + (d*f*x + c*f)*cos(d*x + c) + (d*f*x + c*f)*sin(d*x + c))*log(-cos(d*x + c) + I*sin(d*x + c) + 1 ) + (d*f*x + c*f + (d*f*x + c*f)*cos(d*x + c) + (d*f*x + c*f)*sin(d*x + c) )*log(-cos(d*x + c) - I*sin(d*x + c) + 1) - 2*(f*cos(d*x + c) + f*sin(d*x + c) + f)*log(sin(d*x + c) + 1) - 2*(d*f*x + d*e)*sin(d*x + c))/(a*d^2*cos (d*x + c) + a*d^2*sin(d*x + c) + a*d^2)
\[ \int \frac {(e+f x) \csc (c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\int \frac {e \csc {\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx + \int \frac {f x \csc {\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \]
(Integral(e*csc(c + d*x)/(sin(c + d*x) + 1), x) + Integral(f*x*csc(c + d*x )/(sin(c + d*x) + 1), x))/a
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 514 vs. \(2 (110) = 220\).
Time = 0.30 (sec) , antiderivative size = 514, normalized size of antiderivative = 3.84 \[ \int \frac {(e+f x) \csc (c+d x)}{a+a \sin (c+d x)} \, dx=\frac {4 \, d f x \cos \left (d x + c\right ) + 4 i \, d f x \sin \left (d x + c\right ) - 4 i \, d e - 4 \, {\left (f \cos \left (d x + c\right ) + i \, f \sin \left (d x + c\right ) + i \, f\right )} \arctan \left (\cos \left (c\right ) + \sin \left (d x\right ), \cos \left (d x\right ) + \sin \left (c\right )\right ) + 2 \, {\left (-i \, d f x - i \, d e - {\left (d f x + d e\right )} \cos \left (d x + c\right ) + {\left (-i \, d f x - i \, d e\right )} \sin \left (d x + c\right )\right )} \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right ) + 1\right ) + 2 \, {\left (d e \cos \left (d x + c\right ) + i \, d e \sin \left (d x + c\right ) + i \, d e\right )} \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right ) - 1\right ) - 2 \, {\left (d f x \cos \left (d x + c\right ) + i \, d f x \sin \left (d x + c\right ) + i \, d f x\right )} \arctan \left (\sin \left (d x + c\right ), -\cos \left (d x + c\right ) + 1\right ) + 2 \, {\left (f \cos \left (d x + c\right ) + i \, f \sin \left (d x + c\right ) + i \, f\right )} {\rm Li}_2\left (-e^{\left (i \, d x + i \, c\right )}\right ) - 2 \, {\left (f \cos \left (d x + c\right ) + i \, f \sin \left (d x + c\right ) + i \, f\right )} {\rm Li}_2\left (e^{\left (i \, d x + i \, c\right )}\right ) - {\left (d f x + d e + {\left (-i \, d f x - i \, d e\right )} \cos \left (d x + c\right ) + {\left (d f x + d e\right )} \sin \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1\right ) + {\left (d f x + d e - {\left (i \, d f x + i \, d e\right )} \cos \left (d x + c\right ) + {\left (d f x + d e\right )} \sin \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} - 2 \, \cos \left (d x + c\right ) + 1\right ) + 2 \, {\left (i \, f \cos \left (d x + c\right ) - f \sin \left (d x + c\right ) - f\right )} \log \left (\cos \left (d x\right )^{2} + \cos \left (c\right )^{2} + 2 \, \cos \left (c\right ) \sin \left (d x\right ) + \sin \left (d x\right )^{2} + 2 \, \cos \left (d x\right ) \sin \left (c\right ) + \sin \left (c\right )^{2}\right )}{-2 i \, a d^{2} \cos \left (d x + c\right ) + 2 \, a d^{2} \sin \left (d x + c\right ) + 2 \, a d^{2}} \]
(4*d*f*x*cos(d*x + c) + 4*I*d*f*x*sin(d*x + c) - 4*I*d*e - 4*(f*cos(d*x + c) + I*f*sin(d*x + c) + I*f)*arctan2(cos(c) + sin(d*x), cos(d*x) + sin(c)) + 2*(-I*d*f*x - I*d*e - (d*f*x + d*e)*cos(d*x + c) + (-I*d*f*x - I*d*e)*s in(d*x + c))*arctan2(sin(d*x + c), cos(d*x + c) + 1) + 2*(d*e*cos(d*x + c) + I*d*e*sin(d*x + c) + I*d*e)*arctan2(sin(d*x + c), cos(d*x + c) - 1) - 2 *(d*f*x*cos(d*x + c) + I*d*f*x*sin(d*x + c) + I*d*f*x)*arctan2(sin(d*x + c ), -cos(d*x + c) + 1) + 2*(f*cos(d*x + c) + I*f*sin(d*x + c) + I*f)*dilog( -e^(I*d*x + I*c)) - 2*(f*cos(d*x + c) + I*f*sin(d*x + c) + I*f)*dilog(e^(I *d*x + I*c)) - (d*f*x + d*e + (-I*d*f*x - I*d*e)*cos(d*x + c) + (d*f*x + d *e)*sin(d*x + c))*log(cos(d*x + c)^2 + sin(d*x + c)^2 + 2*cos(d*x + c) + 1 ) + (d*f*x + d*e - (I*d*f*x + I*d*e)*cos(d*x + c) + (d*f*x + d*e)*sin(d*x + c))*log(cos(d*x + c)^2 + sin(d*x + c)^2 - 2*cos(d*x + c) + 1) + 2*(I*f*c os(d*x + c) - f*sin(d*x + c) - f)*log(cos(d*x)^2 + cos(c)^2 + 2*cos(c)*sin (d*x) + sin(d*x)^2 + 2*cos(d*x)*sin(c) + sin(c)^2))/(-2*I*a*d^2*cos(d*x + c) + 2*a*d^2*sin(d*x + c) + 2*a*d^2)
\[ \int \frac {(e+f x) \csc (c+d x)}{a+a \sin (c+d x)} \, dx=\int { \frac {{\left (f x + e\right )} \csc \left (d x + c\right )}{a \sin \left (d x + c\right ) + a} \,d x } \]
Timed out. \[ \int \frac {(e+f x) \csc (c+d x)}{a+a \sin (c+d x)} \, dx=\text {Hanged} \]